// 上传文件路由
const express = require("express");
const router = express.Router();
const {
  uploadFile,
  deleteFile,
  getFileList,
} = require("../controllers/uploadController");
const { protect } = require('../middleware/authMiddleware');

router
  .route("/")
  .get(getFileList) // 获取文件列表
  .post(protect, uploadFile); // 上传文件，需要登录

router.delete("/:filename", deleteFile); // 删除文件

module.exports = router;
